"use client";
import React from "react";
import Link from "next/link";
import {ActionIcon, Box, Button, Group, Text, Tooltip} from "@mantine/core";
import {IconArrowLeft, IconBackhoe} from "@tabler/icons-react";
import classes from "./IpdBasicHeader.module.css";

interface DetailHeaderProps {
  title: string;
  backHref: string;
}

export const IpdBasicHeader = ({backHref, title}: DetailHeaderProps) => {
  return (
    <Box className={classes.box}>
      <Group>
        <Tooltip withArrow label="返回列表" position="left">
          <Button
            component={Link}
            href={backHref}
            variant="outline"
            leftSection={<IconBackhoe size={22} stroke={1.5} />}
          >
            返回方案列表
          </Button>
        </Tooltip>
        <Text size="sm" fw={500}>
          {title}
        </Text>
      </Group>
    </Box>
  );
};
